package com.rou.im.framework.core.processorstack.processor;

import com.rou.im.framework.core.Request;
import com.rou.im.framework.core.Response;
import com.rou.im.framework.core.context.RequestContextHolder;
import com.rou.im.framework.core.processorstack.Processor;
import com.rou.im.framework.core.processorstack.StackInvocation;
import com.rou.im.framework.core.processorstack.TargetAction;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 * @since 2020-05-27 22:23
 */
public class PushToActionProcessor implements Processor {
    @Override
    public void process(Request request, StackInvocation invocation) {
        TargetAction action = RequestContextHolder.getContext().getAction();
        Response response = action.execute(request);
        RequestContextHolder.getContext().setResponse(response);
    }
}
